import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_appdemo02/page/MyProfile.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class Personal extends StatefulWidget {
  @override
  _PersonalState createState() => _PersonalState();
}


List list1 = [
  {
    "tet":"Accidents happn so takeon\n unlimited  rewinds andundo\n dislikes",
  },
  {
    "tet":"Accidents happn so takenon\n unlimited  rewinds andnundo\n dislikes",
  },
  {
    "tet":"Accidents happn so takenon\n unlimited  rewinds anundo\n dislikes",
  },
  {
    "tet":"Accidents happn so takeon\n unlimited  rewinds andundo\n dislikes",
  },
  {
    "tet":"Accidents happn so takeon\n unlimited  rewinds andundo\n dislikes",
  }
];




class _PersonalState extends State<Personal> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Personal"),
        elevation: 0,
        leading: Icon(Icons.settings,color: Colors.grey,size: 34,),
        backgroundColor: Colors.white,
      ),
      body: Padding(
        padding: EdgeInsets.all(2),
        child: Center(
          child: Column(
            children: <Widget>[
              Container(
                width: MediaQuery.of(context).size.width,

                child: Column(
                  children: <Widget>[
                    Stack(
                      children: <Widget>[
                        Container(
                          margin: EdgeInsets.only(top: 20),
                          child: CircleAvatar(
                            radius: 90,
                            backgroundImage: NetworkImage(
                              "http://pics.sc.chinaz.com/files/pic/pic9/201912/zzpic21681.jpg",
                            ),
                          ),
                        ),
                        GestureDetector(
                          child: Container(
                            margin: EdgeInsets.only(left: 140,top: 135),
                            child:  CircleAvatar(
                              child: Image.asset("images/three.png"),
                              backgroundColor: Colors.white,
                            ),
                          ),
                          onTap: () {
                            Navigator.of(context).push(
                              MaterialPageRoute(builder: (context) => MyProfile())
                            );
                          },
                        )
                      ],
                    ),
                    Container(
                      margin: EdgeInsets.only(top: 20,bottom: 20,),
                      child: Text("Hx,34",style: TextStyle(
                        fontSize: 34,
                        fontWeight: FontWeight.w800,
                      ),),
                    ),
                  ],
                ),
                decoration: BoxDecoration(
                  color: Color.fromRGBO(255, 255, 255, 1),
                ),
              ),
              Container(
                padding: EdgeInsets.all(20),
                child: Column(
                  children: <Widget>[
                    Stack(
                      children: <Widget>[
                        Center(
                          child: Container(
                            child: CircleAvatar(
                              radius: 30,
                              backgroundColor: Color.fromRGBO(255, 78, 255, 1),
                              child: Container(
                                height: 35,
                                child: Image.asset("images/zhuanshi.png"),
                              ),
                            ),

                          ),
                        ),
                        Container(
                          height: 65,
                          margin: EdgeInsets.only(top: 50),
                          child: Center(
                            child: Column(
                              children: <Widget>[
                                Text(
                                  "Premiun",
                                  style: TextStyle(
                                    fontWeight: FontWeight.w700,
                                    fontSize: 30,
                                    color: Colors.white,
                                  ),
                                ),
                                Text(
                                  "Data the way you want with premiun",
                                  style: TextStyle(
                                    color: Colors.white
                                  ),
                                )
                              ],
                            ),
                          ),
                          decoration: BoxDecoration(
                            color: Color.fromRGBO(255, 78, 255, 1),
                            borderRadius: BorderRadius.circular(10)
                          ),
                        ),

                      ],
                    ),

                    Container(
                      height: 100,
                      child: Padding(
                        padding: EdgeInsets.only(top: 10,left: 30,right: 30,bottom: 10),
                        child:Swiper(
                          itemBuilder: (BuildContext context, int index) {
                            return Row(
                                  children: <Widget>[
                                    Icon(Icons.refresh,size: 44,color: Colors.purpleAccent,),
                                    Container(
                                      height: 30,
                                      margin: EdgeInsets.only(left: 20),
                                      child:  Text(
                                        list1[index]["tet"],
                                      ),
                                    )
                                  ],
                                );
                          },
                          itemCount: list1.length,
                          pagination:  SwiperPagination(
                            builder: DotSwiperPaginationBuilder(
                              activeColor: Colors.purpleAccent,
                              color: Colors.grey,
                              size: 5,
                              activeSize: 8
                            )
                          ),
                          scrollDirection: Axis.horizontal,
                          autoplay: true,
                        )
                      )
                    ),
                    Padding(
                      padding: EdgeInsets.only(right: 10,left: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          Card(
                            child: Center(
                              child: Column(
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: <Widget>[
                                  Container(
                                    height: 130,
                                    padding: EdgeInsets.only(right: 30,left: 30,top: 30,bottom: 10),
                                    child: Image.asset(
                                      "images/one.png",
                                    ),
                                  ),
                                  Container(
                                    padding: EdgeInsets.only(bottom: 20),
                                    child: Text(
                                        "Boost",
                                      style: TextStyle(
                                        fontSize: 20,
                                        fontWeight: FontWeight.w700,
                                      ),
                                    ),
                                  )
                                ],
                              ),
                            ),

                          ),
                          Card(
                            child: Center(
                              child: Column(
                                children: <Widget>[
                                  Container(
                                    height: 130,
                                    padding: EdgeInsets.only(right: 30,left: 30,top: 30,bottom: 10),
                                    child: Image.asset(
                                        "images/two.png"
                                    ),
                                  ),
                                  Container(
                                    padding: EdgeInsets.only(bottom: 20),
                                    child: Text(
                                      "Priority Chats",
                                      style: TextStyle(
                                        fontSize: 20,
                                        fontWeight: FontWeight.w700,
                                      ),
                                    ),
                                  )
                                ],
                              ),
                            ),

                          )
                        ],
                      ),
                    )

                  ],
                ),
                decoration: BoxDecoration(
                  color: Color.fromRGBO(246, 246, 246, 1),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
